package com.gdufe.common.feign;

import com.gdufe.common.utils.R;
import com.gdufe.common.vo.ReduceStockVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient(name = "mall-product")
public interface ProductFeign {
    /**
     * 信息
     */
    @RequestMapping("product/user/{id}")
    public R info(@PathVariable("id") Long id);

    @PostMapping("product/user/getProduct")
    public R userSelectById(@RequestBody Long id);

    @PostMapping("product/admin/getProduct")
    public R adminSelectById(@RequestBody Long id);

    @RequestMapping("/product/user/reduce")
    public R reduceStock(@RequestBody ReduceStockVo reduceStockVo);

    @RequestMapping("/product/admin/products")
    public R getPros();
}
